// const HtmlWebpackPlugin = require('html-webpack-plugin'); // 通过 npm 安装
// const  {BundleAnalyzerPlugin} = require('webpack-bundle-analyzer')
// const path = require('path');
module.exports = {
  mode: 'development',
  entry: {
    // index: "./src/index.js",
    login: "./src/login.js"
  },
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: '[name].js'
  },   //出口
  resolve:{
    extensions:['.js','.css','json','jsx'],
    modules: [path.resolve(__dirname, 'src'), 'node_modules'],
    unsafeCache: true
  },
  //模块
  module: {
    rules: [
      {
        // test: require.resolve('jquery'),
        // use: {
        //   loader: 'expose-loader',
        //   options: '$'
        // }
      },
    //   { test: /\.css$/, use: ['style-loader', 'css-loader'] },
      {
        test: /\.js$/,
        loader: 'babel-loader',
        // options: {
        //   plugins:["@babel/plugin-syntax-dynamic-import"]  //
        // }
      },
    ]
  },
  //插件
  plugins: [
    // new HtmlWebpackPlugin(),
    // new  BundleAnalyzerPlugin()
  ],
  stats: { children: false },
};